<html>
<head><meta charset="utf-8"><title>ucg implications · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html">ucg implications</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="169894923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ucg%20implications/near/169894923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html#169894923">(Jul 08 2019 at 18:52)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="120791">@RalfJ</span> -- I saw <a href="https://github.com/rust-lang/rust/issues/62149#issuecomment-506944220" target="_blank" title="https://github.com/rust-lang/rust/issues/62149#issuecomment-506944220">your comment on the async-await stabilization</a> issue, and I was wondering if you could say just a <em>bit</em> more? In particular, I don't quite know if the concern you are raising is something somewhat <em>inherent</em> to having "self-referential futures" (i.e., to the intended uses for <code>Pin</code>, as you somewhat suggest), or is something that is tied to some details of how we have implemented futures.</p>



<a name="169894936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ucg%20implications/near/169894936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html#169894936">(Jul 08 2019 at 18:53)</a>:</h4>
<p>Also cc <span class="user-group-mention" data-user-group-id="810">@WG-unsafe-code-guidelines</span></p>



<a name="169902439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ucg%20implications/near/169902439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html#169902439">(Jul 08 2019 at 20:33)</a>:</h4>
<p>What it boils down to is that <code>Pin&lt;&amp;mut F&gt;</code> holds a mutable reference to some location. If that location has an internal mutable reference (allowed by the <code>Pin</code> contract), then the simple rule of "only one mutable reference" dies. Importantly, the outer reference _is_ used between uses of the internal references, so all prior Stacked Borrows model would invalidate the internal reference upon manifesting the outer reference (in e.g. <code>map_unchecked</code>).</p>



<a name="170517089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ucg%20implications/near/170517089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html#170517089">(Jul 10 2019 at 06:54)</a>:</h4>
<p>Right, so basically it is inherent to self-referntial structs <em>if</em> the pointer to the struct is a reference.<br>
If we still had <code>PinMut</code> as a dedicated type, my proposal would have been to use <code>NonNull</code> internally instead. Provide the same API but not actually "be" a reference. That would help (except for <code>map_unchecked*</code>)</p>



<a name="170517095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ucg%20implications/near/170517095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html#170517095">(Jul 10 2019 at 06:54)</a>:</h4>
<p>I can give further details if you want.... after Thursday ;)</p>



<a name="170779561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ucg%20implications/near/170779561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html#170779561">(Jul 13 2019 at 07:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> did I answer your question? It is not really tied to how we have implemented futures and more tied to how we have implemented <code>Pin</code>, I would say.</p>



<a name="170787235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ucg%20implications/near/170787235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html#170787235">(Jul 13 2019 at 12:04)</a>:</h4>
<p>I think you did, yes. It seems like we should not let it block stabilization to me. :)</p>



<a name="170787236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ucg%20implications/near/170787236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ucg.20implications.html#170787236">(Jul 13 2019 at 12:04)</a>:</h4>
<p>But it will be something to sort out.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>